﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio.Modeling.Validation;
using Microsoft.VisualStudio.Modeling;
using System.Drawing.Imaging;
using System.Web;
using System.Collections.ObjectModel;

namespace UofCASE.AgileProductLinerDSL {
    /// <summary>
    /// Implements the Feature domain concept
    /// </summary>
    public partial class Feature {

        /// <summary>
        /// Gets the name of this feature encoded in HTML, enclosed in bold HTML tags and,
        /// if this feature is a reference, enclosed in a HTML "a href" tag
        /// linking to the definition feature model file.
        /// </summary>
        public string HtmlFormattedName {
            get {
                string result = "<b>" + HttpUtility.HtmlEncode(this.Name) + "</b>";
                if (this.IsReference && !string.IsNullOrEmpty(this.DefinitionFeatureModelFile)) {
                    result = "<a href=\"" + this.DefinitionFeatureModelFile.Replace(".fm", ".html") +"\">" + result + "</a>";
                }
                 return result;
            }
        }
    }
}
